using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using Marlimer.Common;

namespace Marlimer.Data.Universal
{
    public class uni_TipoDocIde
    {
        public DataTable getDTTipoDocIde()
        {
            SqlCommand sqlcmd = new SqlCommand();
            SqlDataAdapter da = new SqlDataAdapter();
            DataSet ds = new DataSet();

            sqlcmd.CommandText = "spsdtTipoDocIde";
            sqlcmd.CommandType = CommandType.StoredProcedure;
            sqlcmd.Connection = Session.getConexion();

            da.SelectCommand = sqlcmd;
            da.Fill(ds);
            return ds.Tables[0];
        }

        public DataTable getTipoDocIdeByCod(int ctip_docide)
        {
            SqlCommand sqlcmd = new SqlCommand();
            SqlDataAdapter da = new SqlDataAdapter();
            DataSet ds = new DataSet();

            sqlcmd.CommandText = "spsTipoDocIdeByCod";
            sqlcmd.CommandType = CommandType.StoredProcedure;
            sqlcmd.Connection = Session.getConexion();
            sqlcmd.Parameters.Add("@ctip_docide", SqlDbType.Int);

            sqlcmd.Parameters["@ctip_docide"].Value = ctip_docide;   

            da.SelectCommand = sqlcmd;
            da.Fill(ds);
            return ds.Tables[0];
        }
    }
}
